package com.codrim.cs.data.server.utils;

import com.codrim.cs.data.rpc.dto.result.WholeDayDataResultDTO;

import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

import lombok.experimental.UtilityClass;

/**
 * @author Liang.Zhuge
 * @date 15/03/2018
 */
@UtilityClass
public class CodrimListUtils {
    public static List<WholeDayDataResultDTO> union(List<WholeDayDataResultDTO> l1, List<WholeDayDataResultDTO> l2) {
        List<WholeDayDataResultDTO> tmp = new ArrayList<>();
        if (CollectionUtils.isNotEmpty(l1)) {
            tmp.addAll(l1);
        }
        if (CollectionUtils.isNotEmpty(l2)) {
            tmp.addAll(l2);
        }
        return CollectionUtils.isNotEmpty(tmp) ? tmp : null;
    }
}
